import baseRequest from "@/common/js/request.js"

/**
 * 获取活动分页
 */
function getActivityPage(params) {
	const areaId = params.areaId || uni.getStorageSync("areaId")
	if (areaId) params['userAreaId'] = areaId
	return baseRequest('/jcApi/activity/pageList', params)
}

/**
 * 获取我参与的活动分页
 */
function getMineActivityPage(params) {
  return baseRequest('/jcApi/activity/minePageList', params)
}

/**
 * 获取活动详情
 */
function getActivityDetail(params) {
	return baseRequest('/jcApi/activity/detail', params)
}

/**
 * 获取活动评论分页列表
 */
function getActivityCommentPageList(params) {
	return baseRequest('/jcApi/activityComment/pageList', params)
}

/**
 * 保存活动评论
 */
function saveActivityComment(params) {
	return baseRequest('/jcApi/activityComment/save', params, 'POST')
}

/**
 * 保存点赞
 */
function saveLike(params) {
	return baseRequest('/jcApi/like/save', params, 'POST')
}

/**
 * 保存参加信息
 */
function saveActivityJoin(params) {
	return baseRequest('/jcApi/activity/join', params, 'POST')
}

export{
	getActivityPage,
	getMineActivityPage,
	getActivityDetail,
	saveActivityComment,
	getActivityCommentPageList,
	saveLike,
	saveActivityJoin
}